package com.csun.cmny.provider.model.domain;

import com.csun.cmny.core.mybatis.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

@Data
@Table(name = "cn_dmc_patrol_config")
public class DmcPatrolConfig{

    /**
     * ID
     */
    @Column(name = "id")
    private Long id;

    /**
     * 版本号
     */
    private Integer version;

    /**
     * 巡更时间点 09:00
     */
    @Column(name = "patrol_time")
    private String patrolTime;

    /**
     * 巡更间隔时间 单位:分钟
     */
    @Column(name = "patrol_duration")
    private Integer patrolDuration;

    /**
     * 开始时间 08:00
     */
    @Column(name = "patrol_start")
    private String patrolStart;

    /**
     * 结束时间 10:00
     */
    @Column(name = "patrol_end")
    private String patrolEnd;

    /**
     * 创建人
     */
    private String creator;

    /**
     * 创建人ID
     */
    @Column(name = "creator_id")
    private Long creatorId;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Transient
    private Date createdTime;

    /**
     * 最近操作人
     */
    @Column(name = "last_operator")
    private String lastOperator;

    /**
     * 最后操作人ID
     */
    @Column(name = "last_operator_id")
    private Long lastOperatorId;

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    /**
     * 所属机构
     */
    @Column(name = "group_id")
    private Long groupId;

}